# SPDX-License-Identifier: GPL-2.0
#
# lombo rtc Makefile
#
obj-$(CONFIG_RTC_LOMBO_MOUDLE)		+= rtc.o

ifeq ($(CONFIG_ARCH_LOMBO_N7V1), y)
RTC_CSP_PLATFORM := n7v1
endif
ifeq ($(CONFIG_ARCH_LOMBO_N7V3), y)
RTC_CSP_PLATFORM := n7v3
endif
ifeq ($(CONFIG_ARCH_LOMBO_N7V5), y)
RTC_CSP_PLATFORM := n7v5
endif
ifeq ($(CONFIG_ARCH_LOMBO_N5V1), y)
RTC_CSP_PLATFORM := n5v1
endif
ifeq ($(CONFIG_ARCH_LOMBO_N9V1), y)
RTC_CSP_PLATFORM := n9v1
endif
ifeq ($(CONFIG_ARCH_LOMBO_N9V3), y)
RTC_CSP_PLATFORM := n9v3
endif

SOURCE := $(srctree)/$(src)/csp/$(RTC_CSP_PLATFORM)/rtc_csp.c

ifneq ($(wildcard $(SOURCE)), )
obj-$(CONFIG_RTC_LOMBO_MOUDLE) += csp/$(RTC_CSP_PLATFORM)/
else
obj-y += liblombo_rtc.o
$(obj)/liblombo_rtc.o: $(src)/csp/$(RTC_CSP_PLATFORM)/liblombo_rtc
	cp $< $@
endif
